package com.monise.model;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "ANIMAL")
public class Animal implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
/*	@SequenceGenerator(name="ANIMAL_SEQUENCE", sequenceName="ANIMAL_SEQUENCE", initialValue=1, allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ANIMAL_SEQUENCE")*/
	@Column(name="pkAnimal")
	private Long pkAnimal;
	
	@Column(name = "nome")
	private String nome;
	
	@Column(name = "raca")
	private String raca;
	
	@Column(name = "sexo")
	private String sexo;
	
	@Column(name = "status")
	private int status;
	
	@OneToOne @JoinColumn(name="fkEspecie")
	private Especie especie;
	/*
	@OneToMany
	@JoinTable(name="CONSULTA_ANIMAL",joinColumns=@JoinColumn(name="CON_ID"), inverseJoinColumns=@JoinColumn(name="ANI_ID", unique=false))
	private List<DadosConsulta> consultas;*/
	
	@OneToMany(mappedBy = "animal") 
	private Collection<ClienteAnimal> clienteAnimal;
	
	@Column(name = "foto")
	private String foto ;

	public Long getPkAnimal() {
		return pkAnimal;
	}

	public void setPkAnimal(Long pkAnimal) {
		this.pkAnimal = pkAnimal;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getRaca() {
		return raca;
	}

	public void setRaca(String raca) {
		this.raca = raca;
	}

	public Especie getEspecie() {
		return especie;
	}

	public void setEspecie(Especie especie) {
		this.especie = especie;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Collection<ClienteAnimal> getClienteAnimal() {
		return clienteAnimal;
	}

	public void setClienteAnimal(Collection<ClienteAnimal> clienteAnimal) {
		this.clienteAnimal = clienteAnimal;
	}
	
	@Override
	public String toString() {
		return   nome;
	}

	public String getSexo() {
		return sexo;
	}

	public void setSexo(String sexo) {
		this.sexo = sexo;
	}

	public String getFoto() {
		return foto;
	}

	public void setFoto(String foto) {
		this.foto = foto;
	}

}
